package com.liu.service.impl;

import com.liu.service.HelloService;

import java.util.Random;
import java.util.concurrent.TimeUnit;

/**
 * @author hgvgh
 * @version 1.0
 * @description
 * @date 2021/1/3
 */
public class HelloServiceImpl implements HelloService {

  @Override
  public String sayHello(String name) {

    return "hello : " + name;
  }

  @Override
  public void methedA() {
    this.doMethod("methodA");
  }

  private void doMethod(String methodName) {
    try {
      TimeUnit.MILLISECONDS.sleep(new Random().nextInt(100));
    } catch (InterruptedException e) {
      e.printStackTrace();
    }
    System.out.println("Do method :" + methodName);
  }

  @Override
  public void methedB() {
    this.doMethod("methodB");
  }

  @Override
  public void methedC() {
    this.doMethod("methodC");
  }

}
